require_not_empty

function <T> require_not_empty(value: list<T>?, message: text): list<T>

Checks for empty list and throws an exception if empty.

Since

0.9.0

Parameters

value

The list to be checked.

message

The error message to be thrown if the list is empty.


function <T: -immutable> require_not_empty(value: set<T>?, message: text): set<T>

Checks for empty set and throws an exception if empty.

Since

0.9.0

Parameters

value

The set to be checked.

message

The error message to be thrown if the set is empty.


function <K: -immutable, V> require_not_empty(value: map<K, V>?, message: text): map<K, V>

Checks for empty map and throws an exception if empty.

Since

0.9.0

Parameters

value

The map to be checked.

message

The error message to be thrown if the map is empty.


function <T: -any> require_not_empty(value: T?, message: text): T

Checks for precence of a value and throws an exception if null.

Since

0.9.0

Parameters

value

The nullable or empty value to be checked.

message

The error message to be thrown if the value is null or empty.